home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programmierung
/
Power-Programmierung (Tewi)(1994).iso
/
magazine
/
drdobbs
/
c_spec
/
execute
/
b_getc.c
next >
Wrap
C/C++ Source or Header
|
1986-02-20
|
868b
|
29 lines
#include <stdio.h>
#include <dos.h>
/* B_GETC.C Get a character with a direct video bios call.
* this routine can be used to complement stderr as
* it can be used to get characters from the keyboard, even when input
* redirected. The typed character is returned in the low byte of the
* returned integer, the high byte holds the auxillary byte used to
* mark ALT keys and such. See the Technical Ref for more info.
*
* Copyright (C) 1985 Allen I. Holub. All rights reserved.
*
/*----------------------------------------------------------------------*/
extern void int86( int, union REGS *, union REGS *);
#define KB_INT 0x16 /* Keyboard BIOS interrupt */
#define GETC 0x00 /* Getc is service 0 */
int b_getc()
{
union REGS Regs;
Regs.h.ah = GETC ;
int86( KB_INT, &Regs, &Regs );
return( Regs.x.ax );
}